﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Legend.Component.Common;
using Legend.Component.Interface;
using Legend.Object;

namespace Legend.Component.Monster
{
    public class MonsterDamaging : IDamaging
    {
        private float hp;
        public float HP
        {
            get { return hp; }
            set { hp = value; }
        }
        
        public MonsterDamaging()
        {
            DamageDisposition = DamageType.EnemyFriendly;
        }

        public override string Status
        {
            get { return ""; }
        }

        public override ResolveResult ResolveDamaging(IDamaging.DamageType fromDisposition, float fromDamage, string fromStatus)
        {
            if ((fromDisposition & DamageType.HeroFriendly) != 0) 
            {
                hp -= fromDamage;
                if (hp < 0)
                {
                    GameObjectManager.AddBoardValue("Score", 100 + 20 * (GameObjectManager.GetBoardValue("Combo") + 1));
                    return ResolveResult.Disappear;
                }
            }

            return ResolveResult.Continue;
        }
    }
}
